﻿using System;
using System.Collections;
using System.Runtime.Serialization;

namespace NWebMock
{
    public interface IHttpFileCollection : ICollection, ISerializable
    {
        #region Properties

        /// <summary>
        /// Gets a string array containing the keys (names) of all members in the file collection.
        /// </summary>
        string[] AllKeys { get; }

        /// <summary>
        /// Gets the object with the specified numerical index from the HttpFileCollection.
        /// </summary>
        /// <param name="index">The index of the item to get from the file collection. </param>
        /// <returns>The IHttpPostedFile specified by index.</returns>
        IHttpPostedFile this[int index] { get; }

        /// <summary>
        /// Gets the cookie with the specified name from the cookie collection.
        /// </summary>
        /// <param name="name">Name of item to be returned. </param>
        /// <returns>The IHttpPostedFile specified by name.</returns>
        IHttpPostedFile this[string name] { get; }

        /// <summary>
        /// Gets a NameObjectCollectionBase.KeysCollection instance that contains all the keys in the NameObjectCollectionBase instance.
        /// </summary>
        ICollection Keys { get; }

        #endregion

        #region Methods

        /// <summary>
        /// Returns the IHttpPostedFile object with the specified numerical index from the file collection.
        /// </summary>
        /// <param name="index">The index of the object to be returned from the file collection. </param>
        /// <returns>An IHttpPostedFile object.</returns>
        IHttpPostedFile Get(int index);

        /// <summary>
        /// Returns the IHttpPostedFile object with the specified name from the file collection.
        /// </summary>
        /// <param name="name">The name of the object to be returned from a file collection. </param>
        /// <returns>An IHttpPostedFile object.</returns>
        IHttpPostedFile Get(string name);

        /// <summary>
        /// Returns the name of the HttpFileCollection member with the specified numerical index.
        /// </summary>
        /// <param name="index">The index of the object name to be returned. </param>
        /// <returns>The name of the HttpFileCollection member specified by index.</returns>
        string GetKey(int index);

        /// <summary>
        /// Implements the ISerializable interface and raises the deserialization event when the deserialization is complete.
        /// </summary>
        /// <param name="sender">The source of the deserialization event.</param>
        void OnDeserialization(Object sender);

        #endregion
    }
}